/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bd_imss;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Earving
 */
@Entity
@Table(name = "consultorios")
@NamedQueries({
    @NamedQuery(name = "Consultorios.findAll", query = "SELECT c FROM Consultorios c"),
    @NamedQuery(name = "Consultorios.findByIdConsultorio", query = "SELECT c FROM Consultorios c WHERE c.idConsultorio = :idConsultorio"),
    @NamedQuery(name = "Consultorios.findByNumConsultorio", query = "SELECT c FROM Consultorios c WHERE c.numConsultorio = :numConsultorio")})
public class Consultorios implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_consultorio")
    private Integer idConsultorio;
    @Basic(optional = false)
    @Column(name = "num_consultorio")
    private String numConsultorio;
    @OneToMany(mappedBy = "consultorios")
    private List<Medicos> medicosList;
    @OneToMany(mappedBy = "consultorios")
    private List<Citas> citasList;
    @JoinColumn(name = "id_clinica", referencedColumnName = "id_clinica")
    @ManyToOne(optional = false)
    private Clinicas clinicas;

    public Consultorios() {
    }

    public Consultorios(Integer idConsultorio) {
        this.idConsultorio = idConsultorio;
    }

    public Consultorios(Integer idConsultorio, String numConsultorio) {
        this.idConsultorio = idConsultorio;
        this.numConsultorio = numConsultorio;
    }

    public Integer getIdConsultorio() {
        return idConsultorio;
    }

    public void setIdConsultorio(Integer idConsultorio) {
        this.idConsultorio = idConsultorio;
    }

    public String getNumConsultorio() {
        return numConsultorio;
    }

    public void setNumConsultorio(String numConsultorio) {
        this.numConsultorio = numConsultorio;
    }

    public List<Medicos> getMedicosList() {
        return medicosList;
    }

    public void setMedicosList(List<Medicos> medicosList) {
        this.medicosList = medicosList;
    }

    public List<Citas> getCitasList() {
        return citasList;
    }

    public void setCitasList(List<Citas> citasList) {
        this.citasList = citasList;
    }

    public Clinicas getClinicas() {
        return clinicas;
    }

    public void setClinicas(Clinicas clinicas) {
        this.clinicas = clinicas;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idConsultorio != null ? idConsultorio.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Consultorios)) {
            return false;
        }
        Consultorios other = (Consultorios) object;
        if ((this.idConsultorio == null && other.idConsultorio != null) || (this.idConsultorio != null && !this.idConsultorio.equals(other.idConsultorio))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bd_imss.Consultorios[idConsultorio=" + idConsultorio + "]";
    }

}
